package com.financing.platform.dao.impl;


import java.math.BigDecimal;
import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IWxWithdrawLogDao;
import com.financing.platform.dto.WxWithdrawLogDTO;
import com.financing.platform.util.SqlName;
/**
 * wx_withdraw_log  
 * 提现流水表 数据访问层实现类
 * @author lisu
 *
 */
 
@Repository("wxWithdrawLogDao")
public class WxWithdrawLogDaoImpl extends BaseDaoImpl implements IWxWithdrawLogDao {


	@Override
	public int insert(WxWithdrawLogDTO wxWithdrawLog) throws SQLException {
		return (Integer) this.sqlMapClient.insert(SqlName.WxWithdrawLogSql.insert, wxWithdrawLog);
	}

	@Override
	public void update(WxWithdrawLogDTO wxWithdrawLog) throws SQLException {
		this.sqlMapClient.update(SqlName.WxWithdrawLogSql.update, wxWithdrawLog);
	}

	@Override
	public void updateForce(WxWithdrawLogDTO wxWithdrawLog) throws SQLException {
		this.sqlMapClient.update(SqlName.WxWithdrawLogSql.updateForce, wxWithdrawLog);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClient.delete(SqlName.WxWithdrawLogSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<WxWithdrawLogDTO> queryList(WxWithdrawLogDTO wxWithdrawLog) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.WxWithdrawLogSql.queryList, wxWithdrawLog);
	}

	@Override
	public int queryListCount(WxWithdrawLogDTO wxWithdrawLog) throws SQLException {
		return (Integer) this.sqlMapClient.queryForObject(SqlName.WxWithdrawLogSql.queryListCount, wxWithdrawLog);
	}

	@Override
	public WxWithdrawLogDTO loadById(Integer id) throws SQLException {
		return  (WxWithdrawLogDTO)this.sqlMapClient.queryForObject(SqlName.WxWithdrawLogSql.loadById,id);
	}

	@Override
	public List<WxWithdrawLogDTO> queryAndFaUser(WxWithdrawLogDTO widthDraw) throws SQLException {
		// TODO Auto-generated method stub
		return this.sqlMapClient.queryForList(SqlName.WxWithdrawLogSql.queryAndFaUser, widthDraw);
	}

	@Override
	public BigDecimal sunDraw(WxWithdrawLogDTO widthDraw) throws SQLException {
		// TODO Auto-generated method stub
		return (BigDecimal)this.sqlMapClient.queryForObject(SqlName.WxWithdrawLogSql.sunDraw,widthDraw);
	}

 	
}
